import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/goods_child_info_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class GoodsChildInfoEntity {
  late String goodsPurchaseCode;
  late double weight;
  late double serviceCost;

  GoodsChildInfoEntity();

  factory GoodsChildInfoEntity.fromJson(Map<String, dynamic> json) =>
      $GoodsChildInfoEntityFromJson(json);

  Map<String, dynamic> toJson() => $GoodsChildInfoEntityToJson(this);

  @override
  String toString() => json.encode(this);

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is GoodsChildInfoEntity &&
          runtimeType == other.runtimeType &&
          goodsPurchaseCode == other.goodsPurchaseCode &&
          weight == other.weight &&
          serviceCost == other.serviceCost;

  @override
  int get hashCode => goodsPurchaseCode.hashCode ^ weight.hashCode ^ serviceCost.hashCode;
}
